package com.sitanyun.merchant.guide.adapter;

import android.content.Context;
import android.widget.ProgressBar;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sitanyun.merchant.guide.R;
import com.sitanyun.merchant.guide.bean.RankBean;

/**
 * Created by jzl
 * on 2022/3/25.
 */
public class RankAdapter extends BaseQuickAdapter<RankBean.DataBean, BaseViewHolder> {
       private String type;


    public RankAdapter(Context context,String type) {
        super(R.layout.rank_item);
        this.mContext = context;
        this.type=type;
    }

    @Override
    protected void convert(BaseViewHolder helper, RankBean.DataBean item) {
        //分享次数1,被浏览次数2,互动留言次数3,要求回电次数4,同屏讲解时长5
        ProgressBar pgbar=  helper.getView(R.id.pg_bar);

        switch (item.getQueryType()){
           case 1:
               helper.setText(R.id.tv_rankname,item.getStaffName());
               helper.setText(R.id.tv_ranknum,item.getShare()+"");
               pgbar.setProgress(item.getShare());

             break;
         case 2:
             helper.setText(R.id.tv_rankname,item.getStaffName());
             helper.setText(R.id.tv_ranknum,item.getBrowse()+"");
             pgbar.setProgress(item.getBrowse());
             break;
         case 3:
             helper.setText(R.id.tv_rankname,item.getStaffName());
             helper.setText(R.id.tv_ranknum,item.getMessage()+"");
             pgbar.setProgress(item.getMessage());
             break;
         case 4:
             helper.setText(R.id.tv_rankname,item.getStaffName());
             helper.setText(R.id.tv_ranknum,item.getCalls()+"");
             pgbar.setProgress(item.getCalls());
             break;
         case 5:
             helper.setText(R.id.tv_rankname,item.getStaffName());
             helper.setText(R.id.tv_ranknum,item.getMeetingTime()+"");
             pgbar.setProgress(item.getMeetingTime());
             break;

     }

     }



}
